#pragma once
#include "mtxlib.h"

class camera_t
{
	float m_fViewAngle;
	float m_fW;
	float m_fH;
	float m_fFar;
	float m_fNear;
	float m_fDistance;
	float m_fPhi;
	float m_fTheta;
	matrix44 viewMatrix;
	vector3 eye;
	vector3 dir;
	vector3 up;
public:

	enum message_t {LBUTTONDOWN, LBUTTONUP, RBUTTONDOWN, RBUTTONUP, MOUSEMOVE};
	camera_t() : m_fDistance( 6.0f ), m_fPhi( 0.0f ), m_fTheta( 0.0f ) 
	{
		viewMatrix = LookAtMatrix44(vector3(0.0, 0.0, -10.0), vector3(0.0, 1.0, 0.0), vector3(0.0, 0.0, 0.0));//
	}
	matrix44 getViewMatrix() const;
	matrix44 getProjectionMatrix() const;
	vector3 getPosition() const;
	void setProjection( float viewAngle, float w, float h, float near, float far );
	void setDistance(float fDist) {m_fDistance = fDist;}
	void setDirection(float fPhi, float fTheta) {m_fPhi = fPhi; m_fTheta = fTheta;}
	void mouseProc( int uMsg, int x, int y );
	void setViewMatrix(vector3 _eye, vector3 _up, vector3 _direction);
};

